<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>手机商城</title>
<!-- CSS -->
 
<link rel="stylesheet" href="{url:#css/materialize.min.css}" />
<link rel="stylesheet" href="{url:#css/me.css}" />
<link rel="stylesheet" href="{url:#css/iconfont.css}" />


<style type="text/css">
table tr td{font-size:16px;}

.btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857;
  border-radius: 3px; 
  }
  .btn:hover{
  	background-color:#c71f1f;
  }
  .btn-main 
  {
	  color: #FFF;
	  background-color: #dd2727;
	  border-color: #c71f1f; 
  }
/**去除绿色下划线 - 开始*/
input::-webkit-input-placeholder {
    color: #7e7e7e;
    text-indent: 5px;
}
input:not([type]),input[type=text],input[type=password],input[type=email],input[type=url],input[type=time],input[type=date],input[type=datetime-local],input[type=tel],input[type=number],input[type=search],textarea.materialize-textarea{background-color:transparent;border:none;border-radius:0;outline:none;height:1.5em;width:100%;font-size:1rem;margin:0;padding:0;box-shadow:none;}
input:not([type]):focus:not([readonly]),input[type=text]:focus:not([readonly]),input[type=password]:focus:not([readonly]),input[type=email]:focus:not([readonly]),input[type=url]:focus:not([readonly]),input[type=time]:focus:not([readonly]),input[type=date]:focus:not([readonly]),input[type=datetime-local]:focus:not([readonly]),input[type=tel]:focus:not([readonly]),input[type=number]:focus:not([readonly]),input[type=search]:focus:not([readonly]),textarea.materialize-textarea:focus:not([readonly]){border-bottom:none;box-shadow:none}
/**去除绿色下划线 - 结束*/


</style>
<!-- JS -->
<script src="{url:#js/jquery-1.11.3.min.js}"></script>
<script src="{url:#js/materialize.min.js}"></script>
<script src="{url:#js/home/register.js}"></script>
<script src="{url:#js/yang_check.js}"></script>
</head>
<body class="q-body">
<!-- TitleBar 开始 -->
<div class="navbar-fixed">
  <nav>
    <div class="nav-wrapper red accent-4 valign-wrapper">
      <ul class="left" id="nav-btn-left">
        <li><a><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
      <span class="title-bar-size center_align">转账</span>
      <ul class="right">
        <li><a  class="disabled" style="visibility:hidden"><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
    </div>
  </nav>
</div>
<!-- TitleBar 结束 -->

<div class="container">
	<div class="q-reg-box">
	
	<table>
		
		<tr>
			<td>通用积分</td>
			<td style="font-size:25px;">
				￥<span style="color:red;font-size:25px;">{$mobile_user['currency_point']|'0.00'}</span>
			</td>
		</tr>
		<tr>
			<td>接收账户</td>
			<td>
				<input type="text" name="zz_toname" id="zz_toname" style="display:block;border:1px solid rgb(209,219,205); width:100%; height:35px; font-size:16px; line-height:1.6;" />
			</td>
		</tr>
		<tr>
			<td>转账金额</td>
			<td>
				<input type="text" id="zz_amount" name="zz_amount" placeholder='不能小于1元' style="display:block;border:1px solid rgb(209,219,205); width:100%; height:35px; font-size:16px; line-height:1.6;"/>
			</td>
		</tr>
		<tr>
			<td>短信验证码</td>
			<td>
				<input type="text" name="validate_code" id="validate_code"style="display:block;border:1px solid rgb(209,219,205); width:100%; height:35px; font-size:16px; line-height:1.6;"/>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>
				<input type="button" value="获取短信验证码" id="btn_get_validate" onclick="get_validate_code()" class='btn btn-main'/>
			</td>
		</tr>
		<tr>
			<td>交易密码</td>
			<td>
				<input type="password" name="zz_pass2" id="zz_pass2" style="display:block;border:1px solid rgb(209,219,205); width:100%; height:35px; font-size:16px; line-height:1.6;"/>
			</td>
		</tr>
		<tr>
			<td>备注</td>
			<td>
				<input type="text" name="zz_bz" id="zz_bz" style="display:block;border:1px solid rgb(209,219,205); width:100%; height:35px; font-size:16px; line-height:1.6;"/>
			</td>
		</tr>
		<tr>
			<td colspan='2' style='text-align:center;'>
				<input type="hidden" name='user_id' id='user_id' value="{$mobile_user[id]}"/>
				<a id="a_sub_zz" class='btn btn-main' onclick="a_sub_zz()">开始转账</a>
			</td>
			
		</tr>
	</table>
	
	</div>
</div>
<script type="text/javascript">
function a_sub_zz()
{
	var user_id = $("#user_id").val();
	var zz_toname = $.trim($("#zz_toname").val());
	var zz_bz   = $.trim($("#zz_bz").val());
	var zz_amount  = $.trim($("#zz_amount").val());
	var zz_pass2   = $.trim($("#zz_pass2").val());
	var validate_code = $.trim($("#validate_code").val());

	if( zz_toname == '' )
	{
		//yang_alert('接收账号不能为空');
		//NativeBinder.nativeToast("{'msg':'接收账号不能为空','ms':0}");
		yang_alert('接收账号不能为空');
		return;
	}
	if( isNaN(zz_amount) || zz_amount == '' || zz_amount < 1 )
	{
		yang_alert('转账金额必须为数字且必须大于或等于1');
		return;
	}
	
	if(validate_code == '')
	{
		yang_alert('短信验证码不能为空');
		return;
	}
	
	if( zz_pass2 == '' )
	{
		yang_alert('交易密码不能为空');
		return;
	}

	//$("#a_sub_zz").removeAttr('onclick');
	$("#a_sub_zz").attr('disabled', true);
	$.post('{url:/mobile/zz_do}',{validate_code:validate_code,user_id:user_id,zz_amount:zz_amount,zz_toname:zz_toname,zz_bz:zz_bz,zz_pass2:zz_pass2},function(data){
        if( data['status']=='success' )
	    {
		    yang_alert('操作成功');
		    //个人中心页面
            document.location.href="{url:/mobile/zz}";
        }
        else
	    {
            yang_alert(data['msg']);
            $("#a_sub_zz").attr('disabled', false);
            //document.location.href="{url:/mobile/zz}";
        }
      },'json');
}

function get_validate_code()
{
	var mobile = "{$mobile_user['name']}";
	
	
	$("#btn_get_validate").attr("disabled", true);
	$.post("{url:/simple/sms_send}",{mobile:mobile},function(result){
	      yang_alert(result);
	      $("#btn_get_validate").attr("disabled", false);
	  });
}
</script>

</body>
</html>
